#include <iostream>
using namespace std;
#include <string>
#include <vector>
#include <list>
#include <set>
#include <algorithm>
#include <functional>
#include <numeric>

void printV(vector<int> &v)
{
        for (int i = 0; i < (int)v.size(); i++)
        {
                cout<<v[i] <<" ";
        }
        cout<<endl;
}

void test_accumulate()
{
        vector<int> v1;
        v1.push_back(1);
        v1.push_back(3);
        v1.push_back(5);

        int tmp = accumulate(v1.begin(), v1.end(), 100);
        cout<<tmp<<endl;
}

void test_fill()
{
        vector<int> v1;
        v1.push_back(1);
        v1.push_back(3);
        v1.push_back(5);

       fill(v1.begin(), v1.end(), 8);
       printV(v1);
}

void test_union()
{
        vector<int> v1, v2, v3;
        v1.push_back(1);
        v1.push_back(3);
        v1.push_back(5);

        v2.push_back(1);
        v2.push_back(3);
        v2.push_back(5);

        v3.resize(v1.size() + v2.size());
        set_union(v1.begin(), v1.end(), v2.begin(), v2.end(), v3.begin());
        printV(v3);
}

int main(int argc, char const *argv[])
{
        //test_accumulate();
        //test_fill();
        test_union();
        return 0;
}
